package cn.usian.jyzx.product.service.impl;

import cn.usian.jyzx.model.dto.h5.ProductSkuDto;
import cn.usian.jyzx.model.entity.product.ProductSku;
import cn.usian.jyzx.product.mapper.ProductSkuMapper;
import cn.usian.jyzx.product.service.ProductService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @TODO:
 * @Author:baimu
 * @Date:2024 06 20 11 12
 **/
@Service
public class ProductServiceImpl implements ProductService {
    @Autowired
    ProductSkuMapper productSkuMapper;

    @Override
    public PageInfo<ProductSku> findByPage(Integer page, Integer limit,
                                           ProductSkuDto productSkuDto) {

        PageHelper.startPage(page, limit);
        List<ProductSku> byPage = productSkuMapper.findByPage(productSkuDto);


        return new PageInfo<ProductSku>(byPage);
    }
}
